﻿using System.Text;
using System.IO;
using System.IO.Compression;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Security;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
using System.Xml;
using System.ServiceModel.Security;
using System.ServiceModel.Description;
using System;

namespace Tipler.CompressionEncoder
{
    public class CompressionMessageEncoderFactory : MessageEncoderFactory
    {
        private MessageEncoder _encoder;

        public override MessageEncoder Encoder
        {
            get { return this._encoder; }
        }

        public override MessageVersion MessageVersion
        {
            get { return this.Encoder.MessageVersion; }
        }

        public CompressionMessageEncoderFactory(MessageEncoderFactory messageEncoderFactory)
        {
            if ((messageEncoderFactory == null))
            {
                throw new ArgumentNullException("messageEncoderFactory", "A valid message encoder factory must be passed to the GZipEncoder");
            }
            this._encoder = new CompressionMessageEncoder(messageEncoderFactory.Encoder);
        }

    }
}
